<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>MarkDown</title>
	<link rel="stylesheet" href="<%=path %>/editormd/examples/css/style.css" />
    <link rel="stylesheet" href="<%=path %>/editormd/css/editormd.css" />
    <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
        <script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="static/js/bootstrap.min.js"></script>
		<script src="static/js/ace-elements.min.js"></script>
		<script src="static/js/ace.min.js"></script>
		<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
	    <meta name="description" content="overview & stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="static/css/bootstrap.min.css" rel="stylesheet" />
		<link href="static/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />
		<!-- 下拉框 -->
		<link rel="stylesheet" href="static/css/chosen.css" />
		<link rel="stylesheet" href="static/css/ace.min.css" />
		<link rel="stylesheet" href="static/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="static/css/ace-skins.min.css" />
		<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
		<!--提示框-->
		<script type="text/javascript" src="static/js/jquery.tips.js"></script>
		<script src="<%=path %>/editormd/examples/js/jquery.min.js"></script>
        <script src="<%=path %>/editormd/editormd.min.js"></script>		
  </head>
  
  <body>
  
  <form action="<!-- case/saveCase.do -->" name="caseForm" id="caseForm" method="post">
	 <div id="zhongxin">
	 		
		  
		
				<input type="text" name="case_id" style="height:35px; width:250px;margin:20px;" id="case_id" maxlength="300" placeholder="这里输入案例编号" title="案例图片编号"/>
			
				<input type="text" name="case_title" style="height:35px; width:250px;margin:20px;" id="case_title" maxlength="300" placeholder="这里输入案例标题" title="金典案例标题"/>
				
				<input type="text" name="case_path" style="height:35px; width:250px;margin:20px;" id="case_path"   placeholder="这里输入案例图片地址" title="案例图片地址"/>
				<input type="text" name="case_type" style="height:35px; width:250px;margin:20px;" id="case_type"   placeholder="这里输入类型，1为业务体系，0为案例" title="类型"/>
				<div id="test-editormd">
                <textarea style="display:none;" class="editormd-html-textarea" id="case_desc"></textarea>
				<textarea class="editormd-html-textarea" name="text" id="case_html"></textarea>
            </div>
		
				<div style="text-align: center;">
					<a class="btn btn-smail btn-primary" style="margin:20px;" onclick="save();">保存</a>
					<a class="btn btn-smail btn-danger" style="margin:20px;" onclick="top.Dialog.close();">取消</a>
	           </div>
		<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green"></h4></div>
</form>
	
		
        
        
        <script type="text/javascript">
        
			var testEditor;

            $(function() {
                testEditor = editormd("test-editormd", {
                    width   : "90%",
                    height  : 400,
                    syncScrolling : "single",
                    path    : "<%=path %>/editormd/lib/",
                    theme : "dark",
                    previewTheme : "dark",
                    editorTheme : "pastel-on-dark",
                  /*   markdown : md,  */
                    codeFold : true,
                    imageUpload : true,
                    imageFormats : ["jpg","jpeg","gif","png","bmp","webp"],
                    imageUploadURL : "<%=basePath%>PicSvl",
                    saveHTMLToTextarea : true
                });
           
               
            });
            

         
         
            
            function save(){
                var case_html = $("#case_html").val(); 
            	var case_desc = $("#case_desc").val();
            	/* alert(case_html+'\n'+case_desc); */
            	var case_id = $("#case_id").val();
            	var case_title = $("#case_title").val();
            	var case_path = $("#case_path").val();
            	var case_type = $("#case_type").val();
            	$.ajax(
            		{data:{'case_desc':case_desc,'case_html':case_html,'case_title':case_title,'case_id':case_id,'case_path':case_path,'case_type':case_type},
            		  dataType:'text',
            		  success: function(data){
            		  },
            		  type:'post',
            		  url:'<%=basePath%>case/saveCase.do'
            		}
            	);
            	$("#zhongxin").hide();
        		//$("#zhongxin2").show();
            }
        </script>

  </body>
</html>
